<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
    .container {
        width: 350px;
        height: 300px;
        margin: 0 auto;  /*水平方向居中*/
        /* border: 1px black solid; */
        text-align: center;
    }

    .grey {
        color: grey;
    }

    .container .row {
        width: 350px;
        height: 40px;

        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .container .row input {
        width: 260px;
        height: 30px;
    }

    #submit {
        width: 350px;
        height: 40px;
        background-color: orange;
        color: white;
        border: none;
        margin: 10px;
        border-radius: 5px;
        font-size: 20px;
    }
    </style>
    <script src="https://cdn.staticfile.net/jquery/1.10.2/jquery.min.js"></script>

</head>
<body>
    <div class="container">
        <h1>表白墙</h1>
        <div class="grey">输入后点击提交，会将信息显示在下面的墙上</div>
        <div class="row">
            <span>谁: </span> <input type="text" id="from">
        </div>
        <div class="row">
            <span>对谁: </span> <input type="text" id="to">
        </div>
        <div class="row">
            <span>说: </span> <input type="text" id="say">
        </div>
        <input type="button" value="提交" id="submit" onclick="submit()">
    </div>
    
    <script>
            function submit(){
                let from=$("#from").val();
                let to=$("#to").val();
                let say=$("#say").val();
                let html="<div>"+ from +" 对 "+ to +" 说: "+say+"</div>";
                $(".container").append(html);
                $(":text").val("");
            };
    </script>

</body>
</html>